package com.ego.product.po;

import cn.hutool.core.bean.BeanUtil;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;

import java.io.Serializable;

import com.ego.product.vo.spu.Attr;
import lombok.Data;

/**
 * @program: ego
 * @description sku销售属性&值
 * @author KamTang
 * @date 2022-11-13 12:56:14
 */
@Data
@TableName("pms_sku_sale_attr_value")
public class SkuSaleAttrValue implements Serializable {
	private static final long serialVersionUID = 1L;

	/**
	 * id
	 */
	@TableId
	private Long id;
	/**
	 * sku_id
	 */
	private Long skuId;
	/**
	 * attr_id
	 */
	private Long attrId;
	/**
	 * 销售属性名
	 */
	private String attrName;
	/**
	 * 销售属性值
	 */
	private String attrValue;
	/**
	 * 顺序
	 */
	private Integer attrSort;

	public static SkuSaleAttrValue build(Attr attr, Long skuId) {
		SkuSaleAttrValue entity = BeanUtil.copyProperties(attr, SkuSaleAttrValue.class);
		entity.setSkuId(skuId);
		return entity;
	}
}
